<?php


namespace plugin\coleopenapi\app\admin\validate;


use app\common\validate\BaseValidate;

class AppSignValidate extends BaseValidate
{
    protected $rule = [
        'id' => 'require',
        'app_key' => 'require',
        'app_secret' => 'require',
        'app_name' => 'require',
        'status' => 'require',
        'expired_at' => 'must',
        'limit' => 'number',
        'window_time' => 'number',
        'is_limit' => 'number',
        'module' => 'require',
    ];

    protected $field = [
        'id' => 'ID',
        'app_key' => '应用KEY',
        'app_secret' => '应用秘银',
        'app_name' => '应用名称',
        'status' => '状态',
        'expired_at' => '过期时间',
        'limit' => '请求次数',
        'window_time' => '窗口时间',
        'is_limit' => '是否限流',
        'module' => '授权模块',
    ];
    protected $scene = [
        "id" => [
            'id',
        ],
        "add" => [
            'app_key',
            'app_secret',
            'app_name',
            'status',
            'expired_at',
            'limit',
            'window_time',
            'is_limit',
            'module',
        ],
        "update" => [
            'id',
            'app_key',
            'app_secret',
            'app_name',
            'status',
            'expired_at',
            'limit',
            'window_time',
            'is_limit',
            'module',
        ],
    ];
}